<template>
    <div style="margin-bottom: 30px;display: flex;justify-content: center;align-items: center">
      <el-input
      type="text"
        @keyup.enter="searchClick"
        placeholder="通过书名搜索..."
        prefix-icon="el-icon-search"
        size="small"
        style="width: 400px;margin-right: 10px;"
        autocomplete="on"
        v-model="keywords">
      </el-input>
      
      <el-button size="small"
       type="primary"
       
         @click="searchClick"
           @keydown.enter="searchClick, dianji"
           style="background-color: #19171791;
           border-color: white;" ><el-icon><Search /></el-icon>搜索</el-button>
    </div>
  </template>

<script>
export default {
  name: 'SearchBar',
  data() {
    return {
    keywords:''
  }
  },
  methods: {
    searchClick() {
      this.$emit("onSearch")
      console.log(this.keywords);
    }
}
}
</script>